#ifndef MYCOMBOBOX_H
#define MYCOMBOBOX_H

#include <QComboBox>
#include <QEvent>
#include <QMouseEvent>
#include <QObject>
#include <QStyledItemDelegate>
#include <QWidget>

class MyComboBox : public QComboBox {
  Q_OBJECT
 public:
  explicit MyComboBox(QWidget *parent = 0);
  ~MyComboBox();
  void setState(bool bCanUse) { m_bCanUse = bCanUse; }
  void setFocusWidgetAfterHidePopup(QWidget *focusWidget) {
    m_focusWidget = focusWidget;
  }

 protected:
  virtual void mousePressEvent(QMouseEvent *event);
  virtual void hidePopup();

 signals:
  void clicked();

 private:
  bool m_bCanUse;
  QWidget *m_focusWidget;
};

#endif  // MYCOMBOBOX_H
